import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;
import java.io.IOException;
import javax.imageio.ImageIO;


public class Vaisseau extends Entity {
	
	private double x;
	private double y;
	private double speed;
	private Image sprite;
	private int cadence_tir = 10;
	private int life = 100;
	
	public Vaisseau () {
		
			try {
				sprite = ImageIO.read(getClass().getResource("v_amis.png"));
			} catch (IOException e) {
				e.printStackTrace();
			}
		x = 0;
		y=0;
		speed = 0;
	}

	public void draw(Graphics g) {
		g.drawImage(sprite, (int)Math.round(x), (int)Math.round(y), null);
	}
	
	public void move() {
		
	}
	
	public void move(double dx,double dy) {
		x+=dx;
		y+=dy;
	}
	
	public double getX() {
		return x;
	}
	
	public double getY() {
		return y;
	}
	
	public int getLife() {
		return life;
	}
	
	public int getCadence() {
		return cadence_tir;
	}

	public void setX(double x) {
		this.x = x;
	}
	
	public void setY(double y) {
		this.y = y;
	}
	
	public void setLife() {
		this.life -= 10;
	}
	
	public Rectangle getBounds() {
		return new Rectangle((int) x, (int) y, sprite.getWidth(null), sprite.getHeight(null));
	}

	public double getSpeed() {
		return speed;
	}

	public void setSpeed(double speed) {
		this.speed = speed;
	}

	public Image getSprite() {
		return sprite;
	}

	public void setSprite(Image sprite) {
		this.sprite = sprite;
	}

	@Override
	public boolean getFin() {
		// TODO Auto-generated method stub
		return false;
	}


}
